package com.king01.controller;

import com.king01.service.MenuService;
import com.king01.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：lqs
 * @date ：Created in 2023/9/25 19:12
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @RequestMapping("/leftMenu")
    public Result leftMenu(){
        Result byUserid = menuService.findByUserid();
        return new Result(200,"获取左边菜单",byUserid);
    }

    @RequestMapping("/list")
    public Result list(Integer roleid){
        Result result = menuService.findMenuByRoleId(roleid);
        return result;
    }

    @RequestMapping("/confirmQx")
    public Result confirmQx(Integer roleid,Integer[] ids){
        Result result = menuService.fenPx(roleid, ids);
        return result;
    }
}

